using System;
using System.Collections.Generic;
using System.Text;
using log4net;
using log4net.Config;

namespace SchEdu.Framework.Logging
{

    public class Logger : ILogger
    {
        ILog log;
        public Logger(string name)
        {
            log = LogManager.GetLogger(name);
        }

        public void Debug(object message)
        {
            if (log.IsDebugEnabled)
            {
                log.Debug(message);
            }
        }
        public void Error(object message)
        {
            if (log.IsErrorEnabled)
            {
                log.Error(message);
            }
        }
        public void Warn(object message)
        {
            if (log.IsWarnEnabled)
            {
                log.Warn(message);
            }
        }
        public void Info(object message)
        {
            if (log.IsInfoEnabled)
            {
                log.Info(message);
            }
        }
        public void Fatal(object message)
        {
            if (log.IsFatalEnabled)
            {
                log.Fatal(message);
            }
        }

        public static void InitializeLogging()
        {
            XmlConfigurator.Configure();
        }

    }
}
